@isTest
private  class RemoteActionForWeekTest {
    
    static testMethod void myUnitTest() {
        // Id ldcProfile = [Select Id From Profile Where Name ='系统管理员' or Name='System Administrator'].Id;

        // UserRole ur=[select id,ParentRoleId from UserRole where ParentRoleId!=null limit 1];  

        TestUtils.createUsers();
           
        // User ldc = new User( Alias = 'samLdc7', 
        //                  Email = 'ldc@test.com.maike',
        //                  Emailencodingkey = 'UTF-8', 
        //                  Lastname = 'samLdc', 
        //                  Languagelocalekey = 'en_US',
        //                  Localesidkey = 'en_US', 
        //                  Profileid = ldcProfile, 
        //                  Country = 'United States',
        //                  UserRoleId=ur.Id,
        //                  IsActive = true,
        //                  SubCompany__c='四川省迈克实业有限公司',
        //                  UserDepartment__c='总经办',
        //                  Timezonesidkey = 'America/Los_Angeles', 
        //                  Username = 'ldc@test.com.maike' );
        // insert ldc;

        // User ldc2 = new User( Alias = 'samLdc7', 
        //         Email = 'ldc@test.com.maike',
        //         Emailencodingkey = 'UTF-8', 
        //         Lastname = 'samLdc', 
        //         UserRoleId=ur.ParentRoleId,
        //         Languagelocalekey = 'en_US',
        //         Localesidkey = 'en_US', 
        //         Profileid = ldcProfile, 
        //         Country = 'United States',
        //         IsActive = true,
        //         UserDepartment__c='总经办',
        //         Timezonesidkey = 'America/Los_Angeles', 
        //         Username = 'ldc2@test.com.maike' );
        // insert ldc2;
        
        RemoteActionForWeek.findUser('1','samLdc');
    }

    static testMethod void myUnitTest2() {
        Campaign cam=new Campaign();
        cam.Name='TestCampaign';
        cam.ActivitySite__c='beijing';
        cam.AnnualBudgetTypes__c='年度预算内活动';
        insert cam;
        
        RemoteActionForWeek.findCam('1','Test');
    }

    static testMethod void myUnitTest3() {
        Account acc = TestUtils.createAccount();
        acc.Name = 'TestAcc';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('TerminalCustomer','Account');

        acc.SpecialDepart__c = '内科_呼吸内科; 内科_神经内科';
        acc.CustomerAttribute__c = '公立医疗机构';
        acc.Level__c = '一级甲等';
        insert acc;
        RemoteActionForWeek.findAcc('1','Test');
    }

    static testMethod void myUnitTest4() {
    	Account acc = TestUtils.createAccount();
        acc.Name = 'TestAcc';
        acc.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('TerminalCustomer','Account');
        acc.SpecialDepart__c = '内科_呼吸内科; 内科_神经内科';
        acc.CustomerAttribute__c = '公立医疗机构';
        acc.Level__c = '一级甲等';
        acc.Status__c = '审核通过';
        insert acc;
        
        // Contact con=new Contact();
        // con.AccountId=acc.Id;
        // con.LastName='TestCon';
        // insert con;
        
        RemoteActionForWeek.findCon('1','Test',''+acc.Id+'');
        Opportunity opp = new Opportunity();
        opp.Name = 'TestOpp';
        opp.AccountId = acc.Id;
        opp.StageName = '意向';
        opp.Department__c = '检验科';
        opp.CloseDate = Date.newInstance(2017, 3, 13);
        opp.RecordTypeId = Utils.getRecordTypeIdByDevNameAndObjName('CustomerOpportunity','Opportunity');
        insert opp;
        
        RemoteActionForWeek.findOpp('1','Test');
    }
}